﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.ProductListModels>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<div class="box_tinrao">
	<ul>
    	<li><a href="/product/index/1/0" class="act">Nhà đất bán</a></li>
        <li><a href="/product/index/2/0">Nhà đất cho thuê</a></li>
        <li><a href="/demand/index/1/0">Nhà đất cần mua</a></li>
        <li><a href="/demand/index/2/0">Nhà đất cần thuê</a></li>
    </ul>	
</div>
<div class="clear"></div>
<div class=" line"></div>
<div class="list_cate_1" style="padding-top:0px">
    <ul style="padding-top:0px;">
    	<%foreach (var item in Model.Products)
       { %>
    	<li class="line_dot" style="height:106px">
        	<div class="prd_tt_img">
        	    <a href="/product/details/<%=item.ID %>/<%=Html.ToUrlFriendly(item.Title)%>">
                    <% string imgPath = (item.ImagePath != null && item.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(item.ID, 82, 63, item.ImagePath, Model.ImagePath, Model.ImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
                    <img src="<%=imgPath %>" title="" alt="<%=item.Title %>" width="82" height="63" class="bor_img" />
                </a>
        	</div>
            <div class="tt_txt_tinrao">
            	<h3>
            	    <a href="/product/details/<%=item.ID %>/<%=Html.ToUrlFriendly(item.Title)%>">
                        <%=Html.Encode(item.Title) %>
                    </a>
            	    <%--<%=Html.ActionLink(item.Title, "details", "product",new{id=item.ID}, null)%> --%>
            	</h3>
                <div><%=Html.Encode(item.Summary.Length>150? item.Summary.Substring(0,150)+"...":item.Summary) %></div>
            </div>
            <div class="clear"></div>
            <div class="info">
            	<div style="float: left">Giá: <span class="t_org"><%=item.Cost != null && item.Cost > 0 ? SDT.Lib.Common.Utils.ReadNumber(item.CurrencyID.HasValue && item.CurrencyID.Value == 1 ? (double)item.Cost : (double)item.TotalCost) + "&nbsp;" + item.UnitCost : "Thỏa thuận"%></span>
                	Diện tích: <span class="t_org"><%=item.Area %>m&sup2;</span>
                    Quận/Huyện: <span class="t_org"><%=Html.Encode(item.District.Name) %>,&nbsp;
                                        <%=Html.Encode(item.City.Name) %></span></div>
                <%--<div style="float: right"><%=item.AddDate.Value.ToString("dd/MM/yyyy") %></div>--%>
                <div class="clear"></div>
            </div>
        </li>
        <%} %>        
        <li style="text-align:right"><a href="/product/index/0/1">Xem tiếp&raquo;</a></li>
    </ul>
</div>